package com.landinfo.service.dto;

import com.landinfo.domain.DataType2;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;

/**
 * A DTO for the DataType entity.
 */
public class DataType2DTO implements Serializable {

    private String id;

    @Size(max = 36)
    private String parentId;

    private String name;

    private String code;

    private Integer sorting;

    private String remark;

    private Set<DataType2> children = new LinkedHashSet<DataType2>();

    //private Set<GpsLocationDTO> gpsLocations = new LinkedHashSet<GpsLocationDTO>();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getSorting() {
        return sorting;
    }

    public void setSorting(Integer sorting) {
        this.sorting = sorting;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Set<DataType2> getChildren() {
        return children;
    }

    public void setChildren(Set<DataType2> children) {
        this.children = children;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        DataType2DTO dataTypeDTO = (DataType2DTO) o;
        if (dataTypeDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), dataTypeDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "DataTypeDTO{" +
                "id=" + getId() +
                ", parentId='" + getParentId() + "'" +
                ", name='" + getName() + "'" +
                ", code='" + getCode() + "'" +
                ", sorting='" + getSorting() + "'" +
                ", remark='" + getRemark() + "'" +
                "}";
    }


//    public Set<GpsLocationDTO> getGpsLocations() {
//        return gpsLocations;
//    }
//
//    public void setGpsLocations(Set<GpsLocationDTO> gpsLocations) {
//        this.gpsLocations = gpsLocations;
//    }
}
